/**
 * Created by alan on 2017/4/27.
 * 入河排污口基础信息
 */
Ext.define('Admin.view.baseInfo.ddsbpdoBaseInfo', {
	extend: 'Ext.container.Container',
	xtype: 'ddsbpdoBaseInfo',
	requires: [
		'Admin.store.baseInfo.DdsbpdoBaseInfo'
	],
	//起别名
	alias: 'ddsbpdoBaseInfo',
	controller: 'ddsbpdoBaseController',
	userCLs: 'big-100 small-100',
	margin: 7,
	bodyPadding: 7,
	layout: {
		type: 'vbox',
		align: 'stretch' //拉伸使其充满整个父容器
	},
	height: 200,
	autoLoad: true,
	items: [{
		xtype: 'panel',
		height: 50,
		items: [{
			tbar: [
//				{
//					xtype: "textfield",
//					maxWidth: 200,
//					fieldLabel: "排污口名称",
//					labelWidth: 70,
//					reference: "pdoNm"
//				},
				{
					xtype: "combobox",
					width: 400,
					fieldLabel: "排污口名称",
					reference: "pdoNm",
					displayField: 'pdoNm',
					queryMode: 'local',
					valueField: 'pdoNm',
					triggerAction: 'all',
					anyMatch: true,
					labelWidth: 80,
					listeners: {
						added: function(combo) {
							var _that = this;
							var store = Ext.create("Ext.data.Store", {
								autoLoad: true,
								proxy: {
									type: "ajax",
									url: config.URL+"szy/info/ddsBPdo/list",
									extraParams: {
										river: config.RIVER
									},
									reader: {
										type: 'json',
										rootProperty: 'list',
										totalProperty: 'count'
									}
								}
							});
							combo.setStore(store);
						}
					}
				},
				{
					xtype: "button",
					text: "查询",
					iconCls: 'x-fa  fa-file-o',
					handler: 'check',
					margin: '0 10 0 10',
					// style: 'background-color:#108ee9; border-radius:4px;-webkit-border-radius: 4px;',
					style: 'border-radius:4px;-webkit-border-radius: 4px;'
				}
			],
			margin: '0 0 10 0'
		}, ]
	}, {
		xtype: 'gridpanel',
		title: '排污口名称',
		flex: 1,
		scrollable: true,
		reference: 'ddsbpdoGrid',
		columns: [{
				header: '入河排污口代码',
				dataIndex: 'pdoCd',
				/** editor: 'textfield' ,*/ align: 'center',
				width: '10%'
			},
			{
				header: '入河排污口名称',
				dataIndex: 'pdoNm',
				/** editor: 'textfield' ,*/ align: 'center',
				width: '19%'
			},
			{
				header: '排污许可证代码',
				dataIndex: 'wdpcCd',
				/** editor: 'textfield' ,*/ align: 'center',
				width: '10%'
			},
			{
				header: '地址',
				dataIndex: 'addr',
				/** editor: 'textfield' ,*/ align: 'center',
				width: '10%'
			},
			{
				header: '入河排污口性质',
				dataIndex: 'pdoTp',
				/** editor: 'textfield' ,*/ align: 'center',
				width: '10%',
				renderer: function(value) {
					return getValue('pdotp', value);
				}
			},
			{
				header: '建成日期',
				dataIndex: 'compDt',
				/** editor: 'textfield' ,*/ align: 'center',
				width: '10%',
				// renderer:Ext.util.Format.dateRenderer('Y-m-d H:i:s')
			},
			{
				header: '排放方式',
				dataIndex: 'emisTp',
				/** editor: 'textfield' ,*/ align: 'center',
				width: '7%',
				renderer: function(value) {
					return getValue('emistp', value);
				}
			},
			{
				header: '入河方式',
				dataIndex: 'inRvTp',
				/** editor: 'textfield' ,*/ align: 'center',
				width: '7%'
			},
			{
				header: '排入水功能区名称',
				dataIndex: 'wfzCd',
				/** editor: 'textfield' ,*/ align: 'center',
				width: '10%'
			},
			{
				header: '运行状况',
				dataIndex: 'runCond',
				/** editor: 'textfield' ,*/ align: 'center',
				width: '5.8%',
				renderer: function(value) {
					return getValue('runcond', value);
				}
			}

		],
		store: {
			type: 'ddsbpdoBaseInfo'
		},
		bbar: {
			xtype: 'pagingtoolbar',
			displayInfo: true,
			displayMsg: "显示从第{0}条数据到第{1}条数据，共{2}条数据",
			emptyMsg: "没有记录",
		},
		stripeRows: true,
		columnLines: true,
		plugins: {
			ptype: 'cellediting',
			clicksToEdit: 1
		}
	}]
})